import { defineStore } from "pinia"
import { ref } from "vue"
// 引入菜单数据
import * as api from "@/api/permission.js"

export default defineStore('menulist', () => {
    let menulist = ref([])
    let getMenuList = async () => {
        try {
            let res  = await api.getMenusListApi()
            // console.log(res.data.menuList);
            menulist.value = res.data.menuList
            console.log(menulist.value);
        } catch (e) {
            console.log(e);
        }
    }
    return {menulist,getMenuList}
})